import redis
import uuid
import requests
import time


pool = redis.ConnectionPool(host='129.28.67.244')
r = redis.Redis(connection_pool=pool)
x = r.get('猪头网')
s = int(x)
f = open('keyword', 'r', encoding='utf-8')
current_max = eval(f.readline())[2]
print('{}:{},{}:{}'.format(type(s), s, type(current_max), current_max))
if current_max == s:
    print('ok')
else:
    print('no')

# while True:
#     a = requests.get('http://http.tiqu.qingjuhe.cn/getip?num=1&type=2&pro=0&city=0&yys=0&port=1&pack=31395&ts=1&ys=0&cs=0&'
#                      'lb=1&sb=0&pb=45&mr=0&regions=110000,130000,140000,150000,210000,310000,320000,330000,340000,350000,3'
#                      '60000,370000,410000,420000,430000,440000,500000,510000,530000,610000,620000,640000')
#     ip = a.json()['data'][0]['ip']
#     port = a.json()['data'][0]['port']
#     ip_port = '{0}:{1}'.format(ip, port)
#     print(ip_port)
#     r.set(u'%s' % uuid.uuid1(), ip_port)
#     time.sleep(2)